Add Method (ReportAlerts Collection)

The Add method is used to add a Report Alert object to the report.

Syntax

Function Add (Name As String, DefaultMessage As String, IsEnabled As Boolean, ConditionFormula As String, [MessageFormula as String]) As ReportAlert

Parameter Description

Name

Specifies the name of the Report Alert.

DefaultMessage

Specifies the default message created by the Report Alert.

IsEnabled

Specifies wether or not the Report Alert is enabled when the report is run.

ConditionFormula

Specifies the conditional formula that evaluates when the Report Alert is triggered.

MessageFormula

Optional. Formula used to create the message when the Report Alert is triggered. The result of the formula must be a string, and is created by combining a string with a report field. If MessageFormula is set it will override the value set for DefaultMessage.

Sample

In this example a report is grouped by country and contains a summary of last year's sales per country. The Report Alert will be triggered when the summary of last year's sales exceeds $25,000.00. When the Report Alert is triggered a message is created from the default message and the country name.



Dim name, defaultMessage, conditionFormula, messageFormula As String

'Name of the Report Alert
name = "Sales Alert"

defaultMessage = "Great sales in "

'Conditional formula used to evaluate the Report Alert
conditionFormula = "Sum ({Customer.Last Year's Sales}, 
{Customer.Country}) > 25000"

'Replaces the default message set for the Report Alert. The message is
'created in a formula by concatenating the value set in the
'DefaultMessage parameter, and the group name of the country that
'triggers the Report Alert.
'DefaultAttribute is a function used by the Formula Editor to return
'the default message set for the Report Alert.
messageFormula = "DefaultAttribute & GroupName ({Customer.Country})"

Report.ReportAlerts.Add _
name, defaultMessage, True, conditionFormula, messageFormula



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com